<?php
/**
 * DateTime 2020/8/27 8:59 上午
 * Description:总后台路由
 */

use Illuminate\Support\Facades\Route;


Route::group(['prefix' => 'BK', 'namespace' => 'BK'], function () {
    Route::group(['prefix' => 'auth'], function () {
        //登录
        Route::post('login', 'AuthController@login');
        //登出
        Route::post('logout', 'AuthController@logout');
        //验证码
        Route::get('code', 'AuthController@getCode');
    });
    Route::group(['prefix' => 'admin'], function () {
        Route::put('updatePassword', 'AdminController@updatePassword');

        Route::post('refreshSecret', 'AdminController@refreshGoogleSecret');

        Route::get('adminInfo', 'AdminController@adminInfo');
        //查看用户
        Route::get('admin/{id}', 'AdminController@show');
        //获取登录信息
        Route::get('getAdminInfo', 'AdminController@getAdminInfo');
        //用户列表
        Route::get('admin', 'AdminController@index');
        //添加用户
        Route::post('admin', 'AdminController@store');
        //修改用户
        Route::put('admin', 'AdminController@update');
        //角色列表
        Route::get('role', 'RoleController@index');
        //添加角色
        Route::post('role', 'RoleController@store');
        //修改角色
        Route::put('role', 'RoleController@update');
        //查看角色
        Route::get('role/{id}', 'RoleController@show');
        //删除角色
        Route::delete('role/{id}', 'RoleController@destroy');
        //获取所有权限
        Route::get('privilege', 'PrivilegeController@index');
    });
    Route::group(['prefix' => 'user'], function () {
        Route::get('user/{id}', 'UserController@show');
        Route::get('user', 'UserController@index');
        Route::put('update', 'UserController@update');
    });
    Route::group(['prefix'=>'setting'],function(){
        Route::get('allSetting','SettingController@index');
        Route::put('updateSetting','SettingController@update');
    });
});
